<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<AdminViewModel>" %>

<asp:Content ID="sitemapTitle" ContentPlaceHolderID="TitleContent" runat="server">
	Pixster Album Manager
</asp:Content>

<asp:Content ID="sitemapScript" ContentPlaceHolderID="ScriptContent" runat="server">
    <script src="<%= Url.JsScript("jquery.cookie.js")%>" type="text/javascript"></script>
    <script src="<%= Url.JsScript("menu.js")%>" type="text/javascript"></script>
</asp:Content>

<asp:Content ID="sitemapStyle" ContentPlaceHolderID="StyleContent" runat="server">
</asp:Content>

<asp:Content ID="sitemapContent" ContentPlaceHolderID="MainContent" runat="server">

<%
if (Model != null && Model.DirectoryTree != null && !Model.DirectoryTree.Albums.IsNullOrEmpty())
{
    var index = 0;
%>
<div id="navigation">
	<ul id="menu" class="menu collapsible"> 
<% foreach (var directory in Model.DirectoryTree.Directories)
   { %>
        <li>
            <a class="m<%= ++index %>" href="#"><%= directory.Name%></a>
            <% if (!directory.Directories.IsNullOrEmpty())
               { %>
            <ul>
                <% foreach (var dir in directory.Directories)
                   { %>
                <li><a href="/"><%= dir.Name%></a></li>
                <% } %>
            </ul>
            <% } %>
        </li>
<% } %>
	</ul>
</div>

<% Html.RenderPartial("DirectoryEditorControl", new PixDirectory()); %>
<% } %>

</asp:Content>